package com.common.widght.list;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.lsz.deport.R;

public class CustomView {

    public static int getLayoutView() {
        return R.layout.layout_empty_paylsit;
    }

    public static View getLayoutEmptyView(Context context, int imgEmpty, String buttonStr, int textColor, int buttonBg, View.OnClickListener onClickListener) {
        View layout = LayoutInflater.from(context).inflate(R.layout.layout_empty_paylsit, null, true);
        ImageView iv_empty_icon = layout.findViewById(R.id.iv_empty_icon);
        TextView tv_empty_text = layout.findViewById(R.id.tv_empty_text);
        TextView tv_empty_button = layout.findViewById(R.id.tv_empty_button);

        if (imgEmpty != 0) {
            iv_empty_icon.setImageResource(imgEmpty);
        }

        tv_empty_button.setOnClickListener(onClickListener);
        tv_empty_button.setText(buttonStr);
        tv_empty_button.setTextColor(context.getResources().getColor(textColor));
        tv_empty_button.setBackgroundResource(buttonBg);
        return layout;
    }

}
